package com.acegear.horizon.domain.models.vo;

import com.acegear.horizon.ApplicationContextProvider;
import com.acegear.horizon.domain.models.constraint.DailyFeedType;
import com.acegear.horizon.domain.repository.ClubEventRepository;

/**
 * Created by wangsike on 2017/2/25.
 */
public class DailyEventVO extends DailyFeedVO<ClubEventVO> {
    private ClubEventRepository clubEventRepository;

    public DailyEventVO(Long viewerId, Long feedId) {
        super(viewerId, DailyFeedType.EVENT, feedId);
        init();
        setBody(clubEventRepository.findByEventId(feedId).get().getEventVO());
    }

    private void init() {
        clubEventRepository = ApplicationContextProvider.getBean(ClubEventRepository.class);
    }
}
